<template>
  <div>
    <h3>我是主页</h3>
    <router-link class="btn btn-default" active-class="active" to="/home/H_News">H_News</router-link>
    <router-link class="btn btn-default" active-class="active" to="/home/H_message">H_message</router-link>

    <!-- 让不展示的路由组件保持挂载。不被销毁。   组件名-->
    <keep-alive :include="['H_News','H_message']">
      <router-view></router-view><!--指定组件的呈现位置-->
    </keep-alive>


  </div>
</template>

<script>
export default {
  name: "home",
  // beforeDestroy() {
  //   console.log("home销毁了")
  // },
  mounted() {
    console.log("home挂载了", this)
  }
}
</script>

<style scoped>

</style>